package com.gitee.wsl.compose.ui.richtext.block.list

import androidx.compose.runtime.Composable

/**
 * Defines how to draw list markers for [FormattedList]s that are [ListType.Ordered].
 *
 * These are typically some sort of ordinal text.
 */
 interface OrderedMarkers {
  @Composable
  fun drawMarker(
    level: Int,
    index: Int
  )

   companion object {
    /**
     * Creates an [OrderedMarkers] from an arbitrary composable given the indentation level and
     * the index.
     */
     operator fun invoke(
      drawMarker: @Composable (level: Int, index: Int) -> Unit
    ): OrderedMarkers = object : OrderedMarkers {
      @Composable
      override fun drawMarker(
        level: Int,
        index: Int
      ) {
        drawMarker(level, index)
      }
    }
  }
}